<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>竞价类型</h2>
	</div>
	<div class="cf">
		<div class="fl">
			<a class="btn" href="{:U('addAddress')}">新 增</a>
			<button class="btn ajax-post confirm" url="{:U('changeStatus',array('status'=>1))}" target-form="ids">开启</button>
			<button class="btn ajax-post confirm" url="{:U('changeStatus',array('status'=>0))}" target-form="ids">关闭</button>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">编号</th>
		<th class="">区域名称</th>
		<th class="">状态</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
			<td>{$vo.id} </td>
			<td>{$vo.name}</td>
			<td>
				<switch name="vo.status">
					<case value="0">关闭</case>
					<case value="1">开启</case>
				</switch>
			</td>
			<td>
				<switch name="vo.status">
					<case value="0"><a href="{:U('changeStatus',array('ids'=>$vo['id'],'status'=>1))}" class="ajax-get">开启</a></case>
					<case value="1"><a href="{:U('changeStatus',array('ids'=>$vo['id'],'status'=>0))}" class="ajax-get">关闭</a></case>
				</switch>
				<a href="{:U('editAddress?id='.$vo['id'])}">编辑</a>
            </td>
		</tr>
		</volist>
		<else/>
		<td colspan="5" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
</block>
